﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%-- ReSharper disable RedundantUsingDirective --%>
<%-- ReSharper disable AspUnusedRegisterDirectiveHighlighting --%>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%-- ReSharper restore AspUnusedRegisterDirectiveHighlighting --%>
<%-- ReSharper restore RedundantUsingDirective --%>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchNavTimerJobSettings.aspx.cs" Inherits="SLSearchNavSync.ADMIN.SLSearchNavSync.SearchNavTimerJobSettings" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <SharePoint:StyleBlock runat="server">
        #searchInputBox{ display: none;}
        #siteCollectionsToSyncTr { visibility:collapse; }
    </SharePoint:StyleBlock>
    
    <script type="text/javascript" language="javascript">
        /* Function: handleSyncAllChange
         * Description: Handles the display of the Site Collections to Sync fields
         *              based on the value of the Sync all site collections check box
         */
        function handleSyncAllChange() {
            var syncAllSitesCb = document.getElementById(syncAllSiteCollectionsCbId);
            var siteCollectionsTr = document.getElementById('siteCollectionsToSyncTr');
            
            if (syncAllSitesCb.checked) {
                siteCollectionsTr.style.visibility = 'collapse';
            } else {
                siteCollectionsTr.style.visibility = 'visible';
            }
        }
        
        //on page load make sure to hide / show the site collections to sync field
        _spBodyOnLoadFunctionNames.push("handleSyncAllChange");
    </script>
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
     <table cellpadding="5" cellspacing="2">
        <tbody>
            <tr>
                <td colspan="2">
                    <SharePoint:WebApplicationSelector id="WebApplicationSelectorControl" runat="server"
				        TypeLabelCssClass="ms-listheaderlabel" OnContextChange="WebApplicationSelectorControl_OnContextChange" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="lblSearchSiteUrl" runat="server" Text="Search Center URL: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="tbSearchSiteUrl" runat="server" Width="500"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:CheckBox runat="server" ID="cbSyncAllSiteCollections" Text="Synchronize Search Navigation to all Site Collections in the Web Application" OnClick="handleSyncAllChange();"  />
                </td>
            </tr>
            <tr id="siteCollectionsToSyncTr">
                <td>
                    <asp:Label ID="lblSiteCollectionsUrls" runat="server" Text="Site Collections to Update: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="tbSiteCollectionsUrls" runat="server" Width="500" TextMode="MultiLine" Height="200"></asp:TextBox>
                
                </td>
            </tr>   
            <tr>
                <td>
                    <asp:Label ID="lblSitesToExcludeUrls" runat="server" Text="Sites to exclude: "></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="tbSitesToExcludeUrls" runat="server" Width="500" TextMode="MultiLine" Height="200"></asp:TextBox>
                
                </td>
            </tr>   
            <tr>
                <td colspan="2">
                    <asp:CheckBox runat="server" ID="cbAddThisSite" Text="Include This Site Contextual Search"/>
                </td>
            </tr>   
            <tr>
                <td colspan="2">
                    <asp:CheckBox runat="server" ID="cbThisSiteFirst" Text="Make This Site Contextual Search the first option in Search Drop Down"/>
                </td>
            </tr>                    
            <tr>
                <td colspan="2">
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnOK" runat="server" Text="Apply" OnClick="BtnApply_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:UpdatePanel ID="ajaxUpMain" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
                        <ContentTemplate>
                            <asp:Label ID="lblStatus" runat="server" Text=""></asp:Label>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </tbody>
    </table>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
<%=TimerJobSettingsLabel%>
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
<%=TimerJobSettingsLabel%>
</asp:Content>
